<template>
	<m-layout title="线下充值记录" gap="20 30">
		<m-block bgColor="unset">
			<m-block spa="20 0" gap="30" v-for="(item,index) in listArr">
				<view class="flex-between ptb-8" v-if="item.bankcard">
					<text class="fs26">充值银行卡号</text>
					<text class="fs26">{{item.bankcard||'无'}}</text>
				</view>
				<!-- <view class="flex-between ptb-8">
					<text class="fs26">充值流水号</text>
					<text class="fs26">{{item.tradenum}}</text>
				</view> -->
				<view class="flex-between ptb-8">
					<text class="fs26">充值金额</text>
					<text class="fs26">{{item.amount}}</text>
				</view>
				<view class="flex-between ptb-8">
					<text class="fs26">提交时间</text>
					<text class="fs26">{{item.ctime.replace("T"," ")}}</text>
				</view>
				<view class="flex-between ai-inherit ptb-8">
					<text class="fs26">充值凭证</text>
					<m-image size="140" :src='item.transfervoucher'></m-image>
				</view>
				<view class="flex-between ptb-8" v-if="item.state==2||item.state==3">
					<text class="fs26">审核时间</text>
					<text class="fs26">{{item.vtime.replace("T"," ")}}</text>
				</view>
				<view class="flex-between ptb-8">
					<text class="fs26">状态</text>
					<text v-if="item.state==1" class="fs26 text-primary">待处理</text>
					<text v-if="item.state==2" class="fs26 text-primary">已完成</text>
					<text v-if="item.state==3" class="fs26"  style="color:red">已驳回</text>
				</view>
				<view class="flex-between ptb-8" v-if="item.state==3">
					<text class="fs26">驳回原因</text>
					<text class="fs26" style="color:red">{{item.desccontent}}</text>
				</view>
			</m-block>
		</m-block>
		<m-loading gap="100 0" :list="listArr" :pageIndex="pageIndex" :pageCount="pageCount" :loading="isLoading" />
	</m-layout>
</template>

<script>
	import { tbvRegister, Getutb } from "@/api/Trade.js"
	export default {
		data() {
			return {
				listArr: [],
				pageIndex: 1,
				pageSize: 10,
				pageCount: 1,
				isLoading: false,
			};

		},
		watch: {

		},
		onShow() {
			this.reset()
		},
		methods: {
			// 初始化
			reset() {
				this.pageCount = 1;
				this.pageIndex = 1;
				this.getData();
			},
			// 获取转让记录列表
			async getData() {
				if (this.pageIndex > this.pageCount) {
					return;
				}
				this.isLoading = true;
				const { list, pageCount, success } = await Getutb({
					pageSize: this.pageSize,
					pageIndex: this.pageIndex
				});
				this.isLoading = false;
				this.pageCount = pageCount;
				if (this.pageIndex <= 1) {
					this.listArr = list;
				} else {
					this.listArr = [...this.listArr, ...list];
				}
				this.pageIndex++;
				uni.stopPullDownRefresh();
			}
		},
		onPullDownRefresh() {
			this.reset();
		},
		onReachBottom() {
			this.reset();
			console.log("触底了");
		},
	}
</script>

<style lang="scss">
	.card {
		view+view {
			padding-top: 15rpx;
		}

	}

	.card+.card {
		margin-top: 15rpx;
	}
</style>